package cn.yunhe.controller;
import cn.yunhe.entity.Lib;
import cn.yunhe.entity.Type;
import cn.yunhe.services.ILibServices;
import cn.yunhe.services.ITypeServices;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2018/5/25.
 */
@Controller
@RequestMapping("/problem")
public class TypeController {
    @Resource
    private ITypeServices typeServices;
    @Resource
    private ILibServices libServices;

    @RequestMapping("/type")
    @ResponseBody
    public ModelAndView getTypeAllController(){
        ModelAndView modelAndView=new ModelAndView("ftl/problem");
        List<Type> list=typeServices.findType();
        List<Lib> list1=libServices.findLib();
        modelAndView.addObject("list",list);
        modelAndView.addObject("list1",list1);
        return modelAndView;
    }
}
